const query = require('../models');

module.exports = {
  get: function (req, res) {
    const sql = `
      SELECT s.student_id studentId,s.student_name studentName,c.class_name className 
      FROM students s 
      JOIN classes c 
      ON s.class_id=c.class_id`;
    query(sql, null, function (doc) {
      res.json({
        code: '200',
        msg: '查询成功',
        data: doc
      });
    });
  }
}